import Vue from 'vue'

Vue.directive('Debounce', {
    inserted: function(el, binding) {
        let timer;
        let { fn, delay = t || 500 } = binding.value;
        return function () {
        let args = arguments;
        if (timer) {
            clearTimeout(timer);
        }
        timer = setTimeout(() => {
            timer = null;
            fn.apply(this, args);
        }, delay);
        };
    }
})